package com.huodongjia.controller;

import com.huodongjia.pojo.User;
import com.huodongjia.service.JoinService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/join")
public class JoinController {
    @Autowired
    JoinService joinService;
    @RequestMapping("/insert")
    public void insert(int userId,int activityId){
        joinService.insert(userId,activityId);
    }
    @RequestMapping("/isJoin")
    public boolean isJoin(int userId,int activityId){
        return joinService.isJoin(userId,activityId);
    }
    @RequestMapping("/delete")
    public void delete(int userId,int activityId){
        joinService.delete(userId,activityId);
    }
    @RequestMapping("/findUser")
    public List<User> findUser(int activityId){
        return joinService.findUser(activityId);
    }
}
